package ink.ykb.snowflake.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import ink.ykb.snowflake.config.CodeConstant;
import ink.ykb.snowflake.config.MessageUtil;
import ink.ykb.snowflake.config.ResponseMsg;
import ink.ykb.snowflake.config.SnowflakeIdUtil;
import lombok.extern.slf4j.Slf4j;

@RestController
@RequestMapping("/")
@Slf4j
public class TestController {
	
	@Autowired
	private MessageUtil messageUtil;
	@Autowired
	private SnowflakeIdUtil snowflakeIdUtil;
	

	@RequestMapping("/test")
	public ResponseMsg<Long> test() {
		long result = snowflakeIdUtil.nextId();
		log.info("result：{}",result);
		return new ResponseMsg<>(CodeConstant.SUCCESS_000000,messageUtil.getMessage(CodeConstant.SUCCESS_000000),result);
	}
	
	
	
}
